package com.foreknow.test02;

import java.util.Scanner;

/**
 * 嵌套if
 */
public class CalDiscount {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入是否是会员：是（y）否（n）");
        //接收控制台的输入
        String str = sc.next();
        System.out.println("请输入购物的金额：");
        double money = sc.nextDouble();
        //判断用户是否为会员
        if("y".equals(str)){
            if(money>200)
            {
                money = money * 0.75;
            }else{
                money = money * 0.8;
            }

        }else{
            if(money>100){
                money = money * 0.9;
            }
        }
        System.out.println("实际支付的金额："+money);
    }
}
